<!DOCTYPE html>

<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    {% block head%}
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="{{url_for('static',filename='img/allin2.ico')}}" type="image/x-icon">
    {% block tittle %}
    <title>ALL-IN</title>
    {% endblock %}
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <link href="{{url_for('static',filename='css/font-awesome.min.css',_external=True)}}" rel="stylesheet">
    <link href="{{url_for('static',filename='css/bootstrap.min.css',_external=True)}}" rel="stylesheet">
    <link href="{{url_for('static',filename='css/style.css',_external=True)}}" rel="stylesheet">
    <link href="{{url_for('static',filename='css/responsive.css',_external=True)}}" rel="stylesheet">
    <link href="{{url_for('static',filename='ckeditor/plugins/codesnippet/lib/highlight/styles/default.css',_external=True)}}"
          rel="stylesheet">
    {% endblock %}
</head>
<body>

<header class="main_menu_area navbar_fixed">
    <nav class="navbar navbar-expand-lg navbar-light bg-light">

        <img src="{{url_for('static',filename='img/allin-2.png')}}" width="120" height="50">
        <button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target=".navbar-collapse"
                aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span></span>
            <span></span>
            <span></span>
        </button>
        <div class="navbar-collapse collapse" id="navbarSupportedContent">
            <ul class="navbar-nav">
                <li class="nav-item"><a class="nav-link" href="{{url_for('index')}}" >主页</a></li>
                <li class="nav-item"><a class="nav-link" href="{{url_for('index')}}">广场</a></li>
                <li class="nav-item"><a class="nav-link" href="{{url_for('friends')}}">朋友圈</a></li>
                <li class="nav-item  dropdown submenu ">
                    <a class="dropdown-toggle " id="Dropdown" role="button" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" href="#"><i class="el-icon-edit"></i>写博客</a>
                    <ul class="dropdown-menu" aria-labelledby="Dropdown">
                        <li class="nav-item"><a class="nav-link" href="{{url_for('ckeditor')}}">Html编辑器</a></li>
                        <li class="nav-item"><a class="nav-link"
                                                href="{{url_for('markdown_edit')}}">Markdown编辑器</a></li>
                    </ul>

                </li>
                {% if current_user.is_authenticated %}
                <li class="nav-item dropdown submenu ">
                    <a class="dropdown-toggle " id="notice" role="button" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" href="#">消息中心
                        {% if current_user.new_like()+current_user.new_follow()+current_user.new_comment() !=0 %}
                        <span class="badge">{{current_user.new_like()+current_user.new_follow()+current_user.new_comment()}}</span>
                        {% endif %}
                    </a>
                    <ul class="dropdown-menu" aria-labelledby="Dropdown">
                        <li class="nav-item">
                            <a class="nav-link" href="{{url_for('like_notice')}}">点赞
                            {% if current_user.new_like() != 0 %}
                            <span class="badge">{{current_user.new_like()}}</span>
                            {% endif %}
                        </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link"
                               href="{{url_for('follow_notice')}}">关注
                                {% if current_user.new_follow() != 0 %}
                                <span class="badge">{{current_user.new_follow()}}</span>
                                {% endif %}
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{{url_for('comment_notice')}}">评论
                                {% if current_user.new_comment() != 0%}
                                <span class="badge">{{current_user.new_comment()}}</span>
                                {% endif %}
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="nav-item dropdown submenu ">
                    <a class="dropdown-toggle " id="navbarDropdown" role="button" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false">
                        {% if current_user.avatar%}
                        <img src="{{url_for('static',filename=current_user.avatar)}}" width="30" height="30">
                        {% else %}
                        <img src="{{current_user.default_avatar}}" width="30" height="30">
                        {% endif %}
                    </a>
                    <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                        <li class="nav-item"><a class="nav-link" href="{{url_for('profile')}}">个人中心</a></li>

                        <li class="nav-item"><a class="nav-link"
                                                href="{{url_for('send_code')}}">修改密码</a></li>
                    </ul>
                </li>
                <li class="nav-item"><a class="nav-link" href="{{url_for('logout')}}">注销</a></li>

                {% else %}
                <li class="nav-item"><a class="nav-link" href="{{url_for('user_login')}}">登陆</a></li>
                {% endif %}
            </ul>
        </div>
    </nav>
</header>


<!--================Banner Area =================-->
<section class="banner_area">
    <div class="container">
        <div class="banner_inner_text">
            {% block title%}
            <h2>Blog</h2>
            <p>Blog world</p>
            {% endblock %}
        </div>
    </div>
</section>

<section class="blog_main_area p_100">
    <div class="container">

        <div class="row">
            {%block row%}
            {% endblock %}

            {% for m in get_flashed_messages() %}

            {% endfor %}

            {% block post %}
            {% endblock %}

            {%block col%}
            <div class="col-lg-3">
                <div class="blog_right_sidebar">

                    <aside class="r_widget categories_widget">
                        <div class="r_w_title">
                            <h3>最新发布</h3>
                        </div>
                        <ul>
                            {% for k in news %}
                            <li><a href="{{url_for('posts',id=k.id)}}">{{k.tittle}}</a></li>
                            {% endfor %}

                        </ul>
                    </aside>


                    <aside class="r_widget tag_widget">
                        <div class="r_w_title">
                            <h3>推荐阅读</h3>
                        </div>
                        <ul>
                            {% for h in hot %}
                            <li><a href="{{url_for('posts',id=h.id)}}">{{h.tittle}}</a></li>
                            {% endfor %}
                        </ul>
                    </aside>

                    <aside class="r_widget add_widget">
                        <div class="r_w_title">
                            <h3>Add</h3>
                        </div>
                        <img class="img-fluid" src="{{url_for('static',filename='img/add.jpg')}}" alt="">
                    </aside>
                </div>
            </div>
            {% endblock %}
        </div>
    </div>
</section>

<!--================End Blog Main Area =================-->
{% block comments%}
{%endblock%}
<!--================Footer Area =================-->
<footer class="footr_area">
    <div class="footer_widget_area">
        <div class="container">
            <div class="row footer_widget_inner">
                <div class="col-lg-4 col-sm-6">
                    <aside class="f_widget f_subs_widget">
                        <div class="f_title">
                            <h3>
                                如果您在使用中遇到了问题
                            </h3>
                            <h3>
                                或者您有好的建议，
                            </h3>
                        <h3>
                                请在右方的反馈中提交给我们。
                            </h3>
                        </div>

                    </aside>
                </div>
                <div class="col-lg-4 col-sm-6">
                    <aside class="f_widget f_subs_widget">
                        <div class="f_title">
                            <h3>请输入您的建议</h3>
                        </div>
                        <form action="/issue" method="post">
                            <div class="input-group">
                                <input type="text" class="form-control" placeholder="标题：" name="issuet" required>
                                <input type="text" class="form-control" placeholder="详情：" name="issue" required>
                                <span class="input-group-btn">
                                        <button class="btn btn-lg  btn-block btn-secondary submit_btn" type="submit">反馈</button>
                                    </span>
                            </div>
                        </form>
                    </aside>
                </div>
                <div class="col-lg-4 col-sm-6">
                    <aside class="f_widget f_about_widget">
                        <p><a href="http://www.miitbeian.gov.cn/state/outPortal/loginPortal.action">豫ICP备18009771号</a></p>
                        <p><a href="file:///C:/Users/94061/Desktop/sierra/blog.html#"><i class="fa fa-weibo"></i></a></p>
                    <p><a href="file:///C:/Users/94061/Desktop/sierra/blog.html#"><i class="fa fa-github"></i></a></p>
                    <p><a href="file:///C:/Users/94061/Desktop/sierra/blog.html#"><i class="fa fa-twitter"></i></a>
                    </p>
                    <p><a href="file:///C:/Users/94061/Desktop/sierra/blog.html#"><i class="fa fa-instagram"></i></a>
                    </p>
                    </aside>
                </div>

            </div>
        </div>
    </div>

</footer>
{% block script%}
<script src="{{url_for('static',filename='js/jquery-3.2.1.min.js',_external=True)}}"></script>
<script src="{{url_for('static',filename='js/popper.min.js',_external=True)}}"></script>
<script src="{{url_for('static',filename='js/bootstrap.min.js',_external=True)}}"></script>
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui@2.7.2/lib/index.js"></script>

{% endblock %}
</body>
</html>